W5500 No PHY Link |
您所在的位置:网站首页 › w5500 phy › W5500 No PHY Link |
Thats what I am trying to figure out now… (maybe this post will help some dummy like me…) According to datasheet and code from w5500.h folowing is set __GP_REGISTER8 (PHYCFGR, 0x002E); // PHY Configuration register, Default value: 0b 1011 1000 1 - RST - 7 bit - No Reset (0 RESET) 0 - OPMD - 6 BIT - 0: Configure with the H/W PINs(PMODE[2:0]) 1: Configure with OPMDC[2:0] in PHYCFGR 1 - OPMDC- 5 bit - 1 - OPMDC- 4 bit - 111: All capable, Auto-negotiation enabled 1 - OPMDC- 3 bit - 0 - DPX - 2 bit - Duplex Status [Read Only] - 0 - SPD - 1 bit - Speed Status [Read Only] 0 - LNK - 0 bit - Link Status [Read Only] I need to set sixth bit to 1 so my settings would be: 0b 1101 1000 (HEX:0xD8 - DEC:216) 1 - RST - 7 bit - No Reset (0 RESET) 1 - OPMD - 6 BIT - 0: Configure with the H/W PINs(PMODE[2:0]) 1: Configure with OPMDC[2:0] in PHYCFGR 0 - OPMDC- 5 bit - 1 - OPMDC- 4 bit - 011: 100BT Full-duplex, Auto-negotiation disabled 1 - OPMDC- 3 bit - 0 - DPX - 2 bit - Duplex Status [Read Only] - 0 - SPD - 1 bit - Speed Status [Read Only] 0 - LNK - 0 bit - Link Status [Read Only] Now comes the tricky part that I am not sure about, where to write this value? So far it seems that Ethernet2.cpp could be a good place to put it, when ethernet is initialized: Declare new variable: static const uint8_t myPHYCFGR = 0xD8; void EthernetClass::begin(IPAddress local_ip, IPAddress dns_server, IPAddress gateway, IPAddress subnet) { w5500.init(); Set PHY configuration before or after init? w5500.setPHYCFGR(myPHYCFGR); w5500.setIPAddress(local_ip.raw_address()); w5500.setGatewayIp(gateway.raw_address()); w5500.setSubnetMask(subnet.raw_address()); _dnsServerAddress = dns_server; } Am i looking into right direction? Thank you in advance |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |